<?php
namespace Portal\Model;

use Common\Model\CommonModel;

class TagModel extends CommonModel {
	protected $_validate = array(
		//array(验证字段,验证规则,错误提示,验证条件,附加规则,验证时间)
		array('tag_name', 'require', '标签名称不能为空！', 1, 'regex', 3),
		array('tag_alias','','别名已存在！',2,'unique',3),		
	);
	
	protected $_auto = array (
		array('tag_name', 'trim', 3, 'function' ),
		array('tag_alias', 'trim', 3, 'function' ),
		array('description', 'htmlspecialchars',3, 'function' ), 
	);
	
	protected function _before_write(&$data) {
		parent::_before_write($data);
	}
}
